# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pydotplus
pkgname=('python2-pydotplus' 'python-pydotplus')
_pkgname=pydotplus
pkgver=2.0.2
pkgrel=10
pkgdesc='Provides a Python Interface to Graphviz’s Dot language.'
arch=('any')
url='https://pypi.org/project/pydotplus/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('6f06a1f284401123a4514f9e9a4974dee8dc8d01e6b7c40a797fb70eed22b99fe774272f8b106b5632a33f524b356349fe1ff9633101ff61ef2fc3fe69d641ac')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pydotplus() {
  depends=('python2' 'python2-pyparsing')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-pydotplus() {
  depends=('python' 'python-pyparsing')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

